/*
 * p2954.cpp
 *
 *  Created on: 2013-3-18
 *      Author: zy
 */

#include<algorithm>
#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
struct Point {
	int x, y;
};
int gcd(int a,int b) {
	static int t;
	for(; t=b; b=a%b,a=t);
	return a;
}
void pick(Point *p, int num, int &A, int &E, int &I) {
	A = E = 0;
	for(int i = 0; i < num; i ++) {
		A += p[i].x*p[i+1].y - p[i].y*p[i+1].x;
		E += abs(gcd(p[i].x-p[i+1].x, p[i].y-p[i+1].y));
	}
	A = abs(A);
	I = (A-E)/2+1;
}

int main()
{
	int n,T;
	Point p[10];
	while(scanf("%d%d%d%d%d%d",&p[0].x,&p[0].y,&p[1].x,&p[1].y,&p[2].x,&p[2].y))
	{
		p[3]=p[0];
		if(p[0].x==0&&p[0].y==0&&p[1].x==0&&p[1].y==0&&p[2].x==0&&p[2].y==0)break;
		int E,I,A;
		pick(p,3,A,E,I);
		printf("%d\n",I);
	}
	return 0;
}
